﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.IO;
using TJADRICD.DLL;

using TJADRICD.CollaborativeDesignPlugin.Commission;
using System.Windows.Forms;

namespace TJADRICD.CollaborativeDesignPlugin.Form
{
    public partial class DrawingInput : System.Windows.Forms.Form
    {
        public DrawingInput()
        {
            InitializeComponent();
        }

        private void DrawingInput_Load(object sender, EventArgs e)
        {

        }

        private void Confirm_Click(object sender, EventArgs e)
        {
            DrawingSignList ds = new DrawingSignList();
            //#region 控件数据获取
            //ds.drawingID = DrawingID.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.VALIDATION)] = cbVALIDATION.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.AUDIT)] = cbAUDIT.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.DESIGN_MANAGER1)] = cbDESIGN_MANAGER1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.DESIGN_MANAGER2)] = cbDESIGN_MANAGER2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.PROFESSIONAL_PERSON1)] = cbPROFESSIONAL_PERSON1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.PROFESSIONAL_PERSON2)] = cbPROFESSIONAL_PERSON2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.DESIGN1)] = cbDESIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.DESIGN2)] = cbDESIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.DRAW)] = cbDRAW.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.PROOF)] = cbPROOF.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.BUILD_COUNTERSIGN1)] = cbBUILD_COUNTERSIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.BUILD_COUNTERSIGN2)] = cbBUILD_COUNTERSIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.BUILD_COUNTERSIGN3)] = cbBUILD_COUNTERSIGN3.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.WATER_DRAIN_COUNTERSIGN1)] = cbWATER_DRAIN_COUNTERSIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.WATER_DRAIN_COUNTERSIGN2)] = cbWATER_DRAIN_COUNTERSIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.WATER_DRAIN_COUNTERSIGN3)] = cbWATER_DRAIN_COUNTERSIGN3.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.HVAC_COUNTERSIGN1)] = cbHVAC_COUNTERSIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.HVAC_COUNTERSIGN2)] = cbHVAC_COUNTERSIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.HVAC_COUNTERSIGN3)] = cbHVAC_COUNTERSIGN3.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRONG_ELECTRIC_COUNTERSIGN1)] = cbSTRONG_ELECTRIC_COUNTERSIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRONG_ELECTRIC_COUNTERSIGN2)] = cbSTRONG_ELECTRIC_COUNTERSIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRONG_ELECTRIC_COUNTERSIGN3)] = cbSTRONG_ELECTRIC_COUNTERSIGN3.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRUCUTURE_COUNTERSIGN1)] = cbSTRUCUTURE_COUNTERSIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRUCUTURE_COUNTERSIGN2)] = cbSTRUCUTURE_COUNTERSIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRUCUTURE_COUNTERSIGN3)] = cbSTRUCUTURE_COUNTERSIGN3.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRUCUTURE_COUNTERSIGN4)] = cbSTRUCUTURE_COUNTERSIGN4.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRUCUTURE_COUNTERSIGN5)] = cbSTRUCUTURE_COUNTERSIGN5.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRUCUTURE_COUNTERSIGN6)] = cbSTRUCUTURE_COUNTERSIGN6.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.STRUCUTURE_COUNTERSIGN7)] = cbSTRUCUTURE_COUNTERSIGN7.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.POWER_COUNTERSIGN1)] = cbPOWER_COUNTERSIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.POWER_COUNTERSIGN2)] = cbPOWER_COUNTERSIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.POWER_COUNTERSIGN3)] = cbPOWER_COUNTERSIGN3.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.WEAK_ELECTRIC_COUNTERSIGN1)] = cbWEAK_ELECTRIC_COUNTERSIGN1.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.WEAK_ELECTRIC_COUNTERSIGN2)] = cbWEAK_ELECTRIC_COUNTERSIGN2.Text;
            //ds.SignNameList[Convert.ToInt32(DLL.CONST.ConstCompetence.WEAK_ELECTRIC_COUNTERSIGN3)] = cbWEAK_ELECTRIC_COUNTERSIGN3.Text;


            //#endregion
            FileStream fs = new FileStream("\\..\\Competence\\input.txt", FileMode.OpenOrCreate);
            StreamWriter sw = new StreamWriter(fs);
            sw.Write(ds.drawingID);
            for (int i = 0; i < ds.SignNameList.Length; i++)
            {
                sw.Write(",");
                sw.Write(ds.SignNameList[i]);
            }
            sw.Close();
            fs.Close();
            this.Close();
        }
    }
}
